import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
Vue.use(VueRouter)

let router = new VueRouter({
  // mode: 'history',
  routes,
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

// router.beforeEach((to, from, next) => {
//   router.app.$http('/super/islogin').then((res) => {
//     if (res.data == '1') {
//       next()
//     } else {
//       next();
//       router.push('/login')
//     }

//   })
// })


export default router;